﻿// // ******************************************************************
// //       /\ /|       @file       ResultDto.cs
// //       \ V/        @brief      await29
// //       | "")       @author     Await, 285283010@qq.com
// //       /  |
// //      /  \\        @Modified   2024-11-03 08:11
// //    *(__\_\        @Copyright  Copyright (c) , 2024-11-03 08:11 Await
// // ******************************************************************

namespace AutomaticSubtitles.Service.Infrastructure.Extensions;

public class ResultDto<T> where T : class
{
    public ResultDto()
    {
        Code = "200";
    }

    public ResultDto(T data)
    {
        Data = data;
        Code = "200";
    }

    public ResultDto(T data, uint total)
    {
        Data = data;
        Code = "200";
        Total = total;
    }

    public ResultDto(T data, int total)
    {
        Data = data;
        Code = "200";
        Total = (uint)total;
    }


    /// <summary>
    ///     状态码
    /// </summary>
    public string Code { get; set; }

    /// <summary>
    ///     数据
    /// </summary>
    public T Data { get; set; }

    /// <summary>
    /// 总数据
    /// </summary>
    public uint Total { get; set; }

    /// <summary>
    ///     如果有错误，返回错误信息
    /// </summary>
    public string Message { get; set; }

}

